connect = require '../utils/connect'



main = {}

getHotStave = ()->
	sql = "select * from staves order by hot desc limit 20"
	connect.runSql sql,(err,result)->
		console.log err if err
		main.hotStaves = result

getNewStave = ()->
	sql = "select * from staves order by id desc limit 20"
	connect.runSql sql,(err, result)->
		console.log err if err
		main.newStaves = result

getHotSinger = ()->
	sql = "select * from singers order by hot desc limit 20"
	connect.runSql sql, (err, result)->
		console.log err if err
		main.hotSingers = result
do ()->
	getHotStave()
	getNewStave()
	getHotSinger()

module.exports = main
